---
title: "List"
"og:title": "dub.links.list - Retrieve a list of links - TypeScript SDK"
description: "Retrieve a list of links for the authenticated workspace. The list will be paginated and the provided query parameters allow filtering the returned links."
---

import LinkResponse from "/snippets/link-response.mdx";

## Arguments

<ParamField body="domain" type="string">
  The domain to filter the links by. E.g. `ac.me`. If not provided, all links
  for the workspace will be returned.
</ParamField>

<ParamField body="tagId" type="string">
  The tag ID to filter the links by. This field is deprecated – use `tagIds`
  instead.
</ParamField>

<ParamField body="tagIds" type="string">
  The tag IDs to filter the links by.
</ParamField>

<ParamField body="search" type="string">
  The search term to filter the links by. The search term will be matched
  against the short link slug and the destination URL.
</ParamField>

<ParamField body="userId" type="string">
  The user ID to filter the links by.
</ParamField>

<ParamField body="showArchived" type="boolean" default={false}>
  Whether to include archived links in the response. Defaults to `false` if not
  provided.
</ParamField>

<ParamField body="withTags" type="boolean" default={false}>
  Whether to include tags in the response. Defaults to `false` if not provided.
</ParamField>

<ParamField body="sort" type="string" default="createdAt">
  The field to sort the links by. The default is `createdAt`, and sort order is
  always descending. Available options are `createdAt`, `clicks`, and
  `lastClicked`.
</ParamField>

<ParamField body="page" type="number">
  The page number for pagination (each page contains `100` links).
</ParamField>

## Response

<LinkResponse />

<RequestExample>

```ts
// Find links by domain
await dub.links.list({
  domain: "dub.sh",
});

// Find links by tagIds
await dub.links.list({
  tagIds: ["clv3mewk30001mq0rxl3j3frn"],
});
```

</RequestExample>

<ResponseExample>

```ts
[
  {
    id: "clv3o9p9q000au1h0mc7r6l63",
    domain: "dub.sh",
    key: "e7qzMuI",
    externalId: "123",
    url: "https://www.google.com",
    archived: false,
    expiresAt: null,
    expiredUrl: null,
    password: null,
    proxy: false,
    title: null,
    description: null,
    image: null,
    rewrite: false,
    ios: null,
    android: null,
    geo: null,
    publicStats: false,
    tagId: null,
    tags: [],
    comments: null,
    shortLink: "https://dub.sh/e7qzMuI",
    qrCode: "https://api.dub.co/qr?url=https://dub.sh/e7qzMuI?qr=1",
    utmSource: null,
    utmMedium: null,
    utmCampaign: null,
    utmTerm: null,
    utmContent: null,
    userId: "cludszk1h0000wmd2e0ea2b0p",
    workspaceId: "ws_clugls3tn000lwfotbpy30304",
    clicks: 0,
    lastClicked: null,
    createdAt: "2024-04-17T10:31:00.398Z",
    updatedAt: "2024-04-17T10:31:00.398Z",
    projectId: "clugls3tn000lwfotbpy30304",
  },
];
```

</ResponseExample>
